function PlotIdxNonZeroCompactionVsTotalCompaction( totCompact, idxCompact, nnzCompact, params, epsName )

   figure;
   grid on;
   hold on;
   
   axlims = axis;
   ymin = -1;
   ymax = 13;
   xmin = -1;
   xmax = 13;
   axlims(1) = xmin;
   axlims(2) = xmax;
   axlims(3) = ymin;
   axlims(4) = ymax;
   axis( axlims );
   
   x0 = 2^min( axlims(1) );
   x1 = 2^max( axlims(2) );
   y0 = 2^min( axlims(3) );
   y1 = 2^max( axlims(4) );
   xbase = [ x0 x1 ];
   ybase = [ y0 y1 ];
   
   % make the plot
   idxs = 1:1:length( totCompact );
   for idx = idxs
      xv0 = log2( totCompact( idx ) );
      xv1 = log2( totCompact( idx ) );
      yv0 = log2( idxCompact( idx ) );
      yv1 = log2( nnzCompact( idx ) );
      xline = [ xv0 xv1 ];
      yline = [ yv0 yv1 ];
      plot( xline, yline, 'k', 'LineWidth', 1, 'HandleVisibility', 'off' );
   end
   plot( log2( xbase ), log2( ybase ), 'k', 'LineWidth', params.lineWidth-2, 'HandleVisibility', 'off' );
   
   plot( log2( totCompact ), log2( idxCompact ), params.markers{ 1 }, 'MarkerSize', params.mrkSize, 'MarkerEdgeColor', params.colors( 1, : ), 'MarkerFaceColor', params.colors( 1, : ) );
   plot( log2( totCompact ), log2( nnzCompact ), params.markers{ 3 }, 'MarkerSize', params.mrkSize, 'MarkerEdgeColor', params.colors( 7, : ), 'MarkerFaceColor', params.colors( 7, : ) );
   
   xticks = {};
   yticks = {};
   %set( gca, 'XTick', xmin:1:xmax );
   %set( gca, 'YTick', ymin:2:ymax );
   xtickv = get( gca, 'XTick' );
   ytickv = get( gca, 'YTick' );
   for tickIdx = 1:length( ytickv )
      yv =  2^ytickv( tickIdx );
      if yv < 1
         yticks{ end+1 } = sprintf( '%.2fx',  yv );
      else
         yticks{ end+1 } = sprintf( '%dx',  round( yv ) );
      end
   end
   for tickIdx = 1:length( xtickv )
      xv =  2^xtickv( tickIdx );
      if xv < 1
         xticks{ end+1 } = sprintf( '%.2fx',  xv );
      else
         xticks{ end+1 } = sprintf( '%dx',  round( xv ) );
      end
   end
   set( gca, 'XTickLabel', xticks );
   set( gca, 'YTickLabel', yticks );
   
   legend( 'indices', 'non-zeros', 'Location', 'SouthEast' );
   xlabel( 'total compaction',              'interpreter', 'latex', 'FontWeight', 'bold', 'FontSize', params.fontSize-1 );
   ylabel( 'idxs, non-zeros', 'interpreter', 'latex', 'FontWeight', 'bold', 'FontSize', params.fontSize-1 );

   print( gcf, '-depsc2', epsName );
end

